<template>
  <div>
    <h1>获取用户信息的模块</h1>
    <div>用户名:{{ userInfo }}</div>
    <div>性别:</div>
  </div>
</template>
<script setup lang="ts">
import axios from 'axios'
import { ElMessage } from 'element-plus'
import { onMounted, ref } from 'vue'

const userInfo = ref()
const getInfo = async () => {
  const { data } = await axios.get(`/getInfo`)
  userInfo.value = data
  console.log(data)
}

const getRouters = async () => {
  const { data } = await axios.get(`/getRouters`)
  ElMessage.success(data.msg)
}
onMounted(() => {
  getInfo()
  getRouters()
})
</script>

<style scoped></style>